package cn.org.mrliu.ssm.model;

<#if (table.hasDateType)>
import java.util.Date;

</#if>
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
<#if (parentClass??)>

import ${parentClass};
</#if>

public class ${modelName} <#if (parentClass??)>extends ${parentClassName} </#if>{
	<#list table.columns as column>
	private ${column.dataType.javaTypeName} ${column.name};<#if (column.comment!="") > // ${column.comment}</#if>
	</#list>
	public ${modelName}() {
	
	}
	public ${modelName}(Integer id) {
		this.id = id;
	}
	public ${modelName}(<@compress single_line=true>
		<#list table.baseColumns as column>
			${column.dataType.javaTypeName} ${column.name}<#if (column_index lt table.baseColumns?size-1)>,</#if>
		</#list>
	</@compress>) {
		<#list table.baseColumns as column>
		this.${column.name} = ${column.name};
		</#list>
	}
	public ${modelName}(<@compress single_line=true>
		<#list table.columns as column>
			${column.dataType.javaTypeName} ${column.name}<#if (column_index lt table.columns?size-1)>,</#if>
		</#list>
	</@compress>) {
		<#list table.columns as column>
		this.${column.name} = ${column.name};
		</#list>
	}
	<#list table.columns as column>
	public ${column.dataType.javaTypeName} get${column.name?cap_first}() {
		return ${column.name};
	}
	public void set${column.name?cap_first}(${column.dataType.javaTypeName} ${column.name}) {
		this.${column.name} = ${column.name};
	}
	</#list>
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
	<#--
		String string = "Employee [\n"
				<#list table.columns as column>
				+ "    ${column.name}=" + ${column.name}<#if (column_index < table.columns?size-1)> + ",\n"</#if> 
				</#list>
				+ "\n]";
		return string;
	-->	
	}
	
}
